package cc.zhuzhu8.jizhang.controller;

import cc.zhuzhu8.jizhang.entity.BookClass;
import cc.zhuzhu8.jizhang.entity.RetMessage;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/bookClass")
public class BookClassController {
    @PostMapping("/getBookClassList")
    public RetMessage getBookList() {
        RetMessage retMessage = new RetMessage();
        retMessage.setData(getList());
        retMessage.setResult(true);
        return retMessage;
    }

    private List<BookClass> getList() {
        List<BookClass> list = new ArrayList<>();
        BookClass bookClass = new BookClass();
        bookClass.setBgColor("red");
        bookClass.setBillType(1);
        bookClass.setId(1L);
        bookClass.setIconName("cuIcon-same");
        bookClass.setName("买花");
        list.add(bookClass);
        BookClass bookClass2 = new BookClass();
        bookClass2.setBgColor("red");
        bookClass2.setBillType(1);
        bookClass2.setId(2L);
        bookClass2.setIconName("cuIcon-taxi");
        bookClass2.setName("打车");
        list.add(bookClass2);
        BookClass bookClass3 = new BookClass();
        bookClass3.setBgColor("green");
        bookClass3.setBillType(0);
        bookClass3.setId(3L);
        bookClass3.setIconName("cuIcon-like");
        bookClass3.setName("兼职");
        list.add(bookClass3);
        return list;
    }
}
